from django.db import models
from django.core import validators

# Create your models here.


class Article(models.Model):
    title = models.CharField(max_length=100)
    content = models.TextField(blank=True)
    thumbnial = models.FileField(
        upload_to="files",
        validators=[validators.FileExtensionValidator(
            ['txt'], message='必须为txt文件')],
        blank=True
    )
    img = models.ImageField(blank=True)
